package com.yu.xcx.controller;


import com.yu.xcx.dto.Result;
import com.yu.xcx.entity.BlogComments;
import com.yu.xcx.service.IBlogCommentsService;
import com.yu.xcx.service.IBlogService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/blogComments")
public class BlogCommentsController {

    @Resource
    private IBlogCommentsService iBlogCommentsService;
    
    @PostMapping("/save")
    public Result saveBlogComments(BlogComments blogComments) {
        return Result.ok(iBlogCommentsService.saveBlogComments(blogComments));
    }

    @RequestMapping("/queryByShop")
    public Result queryByShopId(Integer shopId){
        return iBlogCommentsService.queryByShopId(shopId);
    }

    @RequestMapping("/queryByParentId")
    public Result queryByParentId(Integer parentId){
        return iBlogCommentsService.queryByParentId(parentId);
    }
}
